package nrpc.register;

import java.io.IOException;

import nrpc.impl.RegisterHandler;
import nrpc.server.ServerStub;

public class RegisterServer {
	private ServerStub serverStub;
	private RegisterHandlerImpl handlerImpl;
	public RegisterServer(int port, String...services) throws IOException {
		serverStub = new ServerStub(port);
		serverStub.registerInstance(handlerImpl = new RegisterHandlerImpl(services), RegisterHandler.class);
	}
	public void close(){
		serverStub.close();
		handlerImpl.close();
	}
}
